package com.rocket.consumer;

import com.rocket.param.TeduClass;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(
        topic="test-topic-02",
        consumerGroup = "test-consumer-02",
        selectorExpression = "*")
public class SendConsumer implements RocketMQListener<TeduClass> {
    //消费一条消息调用的消费逻辑方法
    //底层实现反序列化,调用方法时,直接传递给我们消息数据
    @Override
    public void onMessage(TeduClass message) {
        System.out.println("消费逻辑接收对象:"+message);
    }
}
